% Amneet Gulati
% Manalis Lab
% June 22, 2009
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Bead Concentration Conversion
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% INSTRUCTIONS: Please enter the following parameters to calculate 
% (1) stock concentration
% (2) volume of stock and water to add to achieve target concentration

% *REQUIRED PARAMETERS* solid fraction, density of the material, diameter of  bead
% *OPTIONAL PARAMETERS* target concentration, target total volume


clear all
clc

% input the Solid Fraction in solution - generally 1% or 10%
massfrac = 0.01;

% input the Material Density: Polystyrene = 1.05 g/cm^3; Silica = 1.8
% g/cm^3; Melamine = 1.57 g/cm^3
density = 1.05; %(in g/cm^3)

% input Particle Size (diameter)
diameter = 8.62; %(in microns)

% input Target Concentration
target_conc = 1*10^6; % ( in # of beads/ml)

% input Target Volume
target_vol = 10; % (in ml)

vol_bead = (4*pi/3)*(diameter/2).^3*10^-18; % (in m^3)
stock_conc = (massfrac ./ (density*10^6))./vol_bead;

disp(['Stock concentration is ', num2str(stock_conc),' beads/ml'])

bead_stock_vol = (target_conc./stock_conc) .* target_vol;
water_vol = target_vol - bead_stock_vol;

disp(['Add ', num2str(bead_stock_vol), 'ml bead stock in ', num2str(water_vol), 'ml water.'])
